<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用for while do...while循环语句</title>
<script language= "javascript">
var str= "9";
for(i=0;i<4;i++){
	str = "0"+str;
}
document.write(str+"");

var i = 0;
var str = "9";
while(i<4){
	str="0"+str;
	i++;
}
document.write(str+"");

var i =0;
var str = "9";
do{
	str = "0"+str;
	i++;
}
while(i<4);
document.write(str+"");
</script>
</head>
<body>

</body>
</html>